/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Steed
 */
package bcit.nxt.mission;

// TurtleSquare.java
import gin.and.tonic.*;
import lejos.nxt.Button;

public class SensorEvent implements UltrasonicListener, TouchListener, LightListener
{

    private DragonRobot robot = new DragonRobot();
    UltrasonicSensor us = new UltrasonicSensor(SensorPort.S1);
    TouchSensor ts = new TouchSensor(SensorPort.S2);
    LightSensor lsLeft = new LightSensor(SensorPort.S3);
    LightSensor lsRight = new LightSensor(SensorPort.S4);
    Motor arm = new Motor(MotorPort.A);
    int v = 300;
    double r = 0.15;
    int count = 0;

    SensorEvent()
    {


        arm.setSpeed(10);
        robot.addPart(arm);
        robot.addPart(us);
        robot.addPart(ts);
        robot.addPart(lsLeft);
        robot.addPart(lsRight);

        lsLeft.activate(true);
        lsRight.activate(true);



       us.addUltrasonicListener(this, 15);
       //ts.addTouchListener(this);
        lsLeft.addLightListener(this, v);
        lsRight.addLightListener(this, v);


        robot.right(360);
        robot.exit();

       


    }

    public void far(SensorPort port, int level)
    {
    }

    public void near(SensorPort port, int level)
    {
         

         

    }

    public void pressed(SensorPort port)
    {
        
    }

    public void released(SensorPort port)
    {
    }

    public void bright(SensorPort port, int level)
    {

       



    }

    public void dark(SensorPort port, int level)
    {
        
        
    }

    public static void main(String[] args)
    {

        new SensorEvent();
    }
}
